﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace ProjectNocturnalFool
{
    class TextMessengerControl : UserControl
    {
        //TextboxControl textbox;
        //TextMessageFieldControl textfield;

        //Velocity opacityVel;

        ///// <summary>
        ///// Constructs TextMessengerControl object
        ///// </summary>
        //public TextMessengerControl()
        //    : base()
        //{
        //    singleton = true;
        //}

        ///// <summary>
        ///// Loads Content of TextMessengerControl
        ///// </summary>
        //public override void LoadContent()
        //{
        //    //base.LoadContent();
        //    //isDraggable = false;
        //    //UserControl ctrlAdd;

        //    //_bgTexture = TacticsGame.Instance.Content.Load<Texture2D>(Constants.TextureTextboxRegular);
        //    //opacityVel = new Velocity(opacity, opacity, Constants.OpacityVelocity);

        //    //width = Constants.TextMessengerWidth;
        //    //height = Constants.TextMessengerHeight;

        //    ////ctrlAdd = UILoader.addTextBox(x, y);
        //    //ctrlAdd.y = height - ctrlAdd.height + y;
        //    //ctrlAdd.width = width;
        //    //textbox = (TextboxControl)ctrlAdd;

        //    //controls.Add(ctrlAdd);


        //    ////ctrlAdd = UILoader.addTextField(x, y);
        //    //ctrlAdd.width = width;
        //    //ctrlAdd.height = height - textbox.height + y;


        //    //textfield = (TextMessageFieldControl)ctrlAdd;

        //    //controls.Add(ctrlAdd);
        //}

        ///// <summary>
        ///// Updates logic based on mouse
        ///// </summary>
        //public override void Update(GameTime gameTime)
        //{
        //    base.Update(gameTime);
        //    if (Selected)
        //    {
        //        opacityVel.targetSpeed = 1;
        //    }
        //    else
        //    {
        //        opacityVel.targetSpeed = 0.01f;
        //    }
            
        //    opacityVel.Update();
        //    opacity = opacityVel.currentSpeed;

        //    textbox.opacity = opacity;
        //    textfield.opacity = opacity;

        //    textbox.Selected = Selected;

        //    if (textbox.sendMessage)
        //    {
        //        NetworkMgr.Instance.SendMessage(Network_Message_Type.Message, textbox.message);
        //        textbox.message = "";
        //        textbox.sendMessage = false;
        //    }
            
        //}
        //public override void Draw(GameTime gameTime)
        //{
        //    TacticsGame.Instance.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);

        //    Rectangle targetRect = new Rectangle(x, y, width, height);
        //    if (Selected)
        //    {

        //        TacticsGame.Instance.spriteBatch.Draw(_bgTexture, targetRect, null, Color.White * 0.1f, 0, Vector2.Zero, SpriteEffects.None, 0);
        //    }
        //    else
        //    {
        //        TacticsGame.Instance.spriteBatch.Draw(_bgTexture, targetRect, null, Color.White * 0.1f, 0, Vector2.Zero, SpriteEffects.None, 0);
        //    }

        //    TacticsGame.Instance.spriteBatch.End();

        //    base.Draw(gameTime);
        //}

    }
}
